package com.luyue.zagj.fragment;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import com.luyue.zagj.BaseActivity;
import com.luyue.zagj.MyApplication;
import com.luyue.zagj.R;
import com.luyue.zagj.activity.home.ApplyLabelActivity;
import com.luyue.zagj.activity.home.VehicleInfoActivity;
import com.umeng.analytics.MobclickAgent;

import butterknife.Bind;
import butterknife.ButterKnife;
import butterknife.OnClick;

/**
 * Created by luyue on 2016/11/21.
 */

public class ServiceZFragment extends Fragment {
    @Bind(R.id.service_car_tv)
    TextView serviceCarTv;
    @Bind(R.id.service_repair_tv)
    TextView serviceRepairTv;
    @Bind(R.id.service_applayable)
    TextView serviceApplayable;
    private View view;

    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        view = inflater.inflate(R.layout.main_fragment_servicet, container, false);
        ButterKnife.bind(this, view);
        return view;
    }

    public void onResume() {
        super.onResume();
        MobclickAgent.onResume(MyApplication.getContext());
    }

    public void onPause() {
        super.onPause();
        MobclickAgent.onResume(MyApplication.getContext());
    }

    @Override
    public void onDestroyView() {
        super.onDestroyView();
        ButterKnife.unbind(this);
    }

    @OnClick({R.id.service_car_tv, R.id.service_repair_tv, R.id.service_applayable})
    public void onClick(View view) {
        switch (view.getId()) {
            case R.id.service_car_tv:
                startIntent(VehicleInfoActivity.class);
                break;
            case R.id.service_repair_tv:
                startIntent(VehicleInfoActivity.class);
                break;
            case R.id.service_applayable:
                startIntent(ApplyLabelActivity.class);
                break;
        }
    }
    public void startIntent(Class aClass){
        Intent intent=new Intent(this.getContext(),aClass);
        startActivity(intent);

    }
}
